<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of CsSubmenu
 *
 * @author gangster
 */
require_once '../Control/CsCtrlData.php';
require_once '../Data/CsConexion.php';
class CsSubMenu extends CsConexion {
    var $tabla;
    var $atributo;
    var $dato;
    var $ncol;
    var $nllave;
    
    function  CsMarca(){
        $this->tabla = "submenu";
        $this->atributo[0]="subcod";
        $this->atributo[1]="subnom";
        $this->atributo[2]="mencod";
        $this->ncol=3;
        $this->nllave=1;
    }
    
    function GuardarDato(){
        $objcontrol = new CsCtrlData();
        $sql = $objcontrol->Insert($this->tabla, $this->dato, $this->ncol);
        return $this->Transaccion($sql);
    }
    
    function ActualizarDato(){
        $objcontrol = new CsCtrlData();
        $sql = $objcontrol->Update($this->tabla, $this->dato, $this->atributo, $this->ncol, $this->nllave);
        return $this->Transaccionx($sql);
    }
    
    function EliminarDato(){
        $objcontrol = new CsCtrlData();
        $sql = $objcontrol->Delete($this->tabla, $this->dato, $this->atributo, $this->nllave);
        return $this->Transaccionx($sql);
    }
    
    function TraerDatos(){
        $sql = "select * from $this->tabla";
        return $this->Transaccion($sql);
    }
}

?>
